package com.pinoc.demo.controller.user;

import javax.annotation.Resource;
import javax.validation.Valid;

import com.pinoc.demo.domain.user.User;
import com.pinoc.demo.manager.UserManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yinpeng10
 */
@RestController
@RequestMapping("user")
public class UserController {

	@Resource
	private UserManager userManager;

	@GetMapping("all")
	@ResponseBody
	public void selectAll() {
		List<User> users = userManager.selectAll();
		users.forEach(s -> {
			System.out.println(s.getName());
		});
	}
}
